﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using pay.BLL;
using pay.Entity;
public partial class newproduct_productdialog_pddialog : System.Web.UI.Page
{
    public string m_productname = "";//产品名称
    public string m_price = "";//原价
    public string m_nowprice = "";//现价
    public string lines1 = "";
    public string lines2 = "";
    public string m_productid = "";//产品编号
    protected void Page_Load(object sender, EventArgs e)
    {
        ProductBLL bll = new ProductBLL();
        Product product = new Product();
        if (!IsPostBack)
        {
            var pid = Request["productid"]; //产品编号
            int productid = 0;
           
            try
            {
             
              this.usertype.Style.Add("display", "none");
              this.usercheck.Style.Add("display", "none");
              productid = int.Parse(pid);
              product=bll.GetElementById(productid); //根据产品编号取得产品信息
              m_productid = productid+"";
              if (product != null)
              {
                  m_productname = TempProductname(productid);
                  m_price = product.Price+"";
                  m_nowprice = product.Nowprice+"";
                  //m_productid = productid;
                  if (productid == 31 || productid == 33 || productid == 34 || productid == 35)
                  {
                      lines1 = "<li class=\"dg_line\"></li>";
                      this.usertype.Style.Add("display", "block");
                      if (productid == 34)
                      {
                          lines2 = "<li class=\"dg_line\"></li>";
                          this.usercheck.Style.Add("display", "block");
                      }
                      else
                      {
                          this.usercheck.Style.Add("display", "none");
                      }
                  }
                 

              }
            }
            catch
            {
                productid = 0;
            }
        }
    }

    public string TempProductname(int productid) //设置产品大类名称
    {   
        /*31-new(1年),33,34-old(),35 手机主力版*/
        /*36 益盟超盘手乾坤版软件(一年版)*/
        string tmpmsg = "";
        if (productid == 31 || productid == 33 || productid == 34 || productid == 35)
        {
            tmpmsg = "手机操盘手主力版";
        }
        switch (productid)
        { 
            case 36:
                tmpmsg = "操盘手乾坤版";
                break;
            case 1:
                tmpmsg = "操盘手决策版";
                break;
            case 32:
                tmpmsg = "操盘手主力版";
                break;
            case 45:
                tmpmsg = "手机操盘手决策版";
                break;
            case 43:
                tmpmsg = "操盘手盯盘先锋";
                break;
            case 17:
                tmpmsg = "操盘手加密狗";
                break;
           
        }
        return tmpmsg;
    }
    
}